
Partial Class Admin_frmModifyScheme
    Inherits System.Web.UI.Page
    Dim VarSchemeId As String
    Dim _SchemeVO As New SchemeVo
    Dim _BO As New Bo
    Dim _EmployeeId As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _EmployeeId = Session("EmpId")
        If _EmployeeId = "" Then
            Response.Redirect("../Client/frmLogin.aspx")
        End If
        VarSchemeId = Request.QueryString("SchemeId")
        If VarSchemeId = "" Then
            Response.Redirect("frmTabScheme.aspx")
        Else
            If Not IsPostBack Then
                GetSchemeData()
            End If
        End If
    End Sub   
    Sub GetSchemeData()
        _SchemeVO = _BO.getSchemeById(VarSchemeId)
        lblSchemeId.Text = _SchemeVO.SchemeId
        txtDiscount.Text = _SchemeVO.Discount
        txtDiscription.Text = _SchemeVO.Description
    End Sub

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        SetData()
        Session("EmpId") = _EmployeeId
    End Sub
    Sub SetData()
        _SchemeVO.SchemeId = lblSchemeId.Text
        _SchemeVO.Discount = txtDiscount.Text
        _SchemeVO.Description = txtDiscription.Text
        _BO.ModifyScheme(_SchemeVO)
        ClearAll()
    End Sub
    Public Sub ClearAll()
        txtDiscount.Text = ""
        txtDiscription.Text = ""
        MsgBox("Scheme Modified")
        Response.Redirect("frmTabScheme.aspx", False)
    End Sub

    Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
        txtDiscount.Text = ""
        txtDiscription.Text = ""
    End Sub
End Class
